const express = require('express')
const app = express()

app.use(express.static(__dirname))
// 获取get post提交的数据
app.use(express.json())
app.use(express.urlencoded({ extended: true }))
//解决跨域
const cors = require('cors')
app.use(cors())

// const db = require('./moogodb/index')
// 管理员
const admin = require('./router/adminRouter')
app.use(admin)


app.listen(8081, () => {
  console.log('server is running at http://127.0.0.1:8081');
})